<?php
//获取文件拓展名 explode()
$file = 'index.php';
$ext = explode('.', $file);
echo $ext[1];
echo '<br>';
echo "<hr>";
//获取文件拓展名 substr() strpos()
$file = 'index.php';
$ext = substr($file, strpos($file, '.') + 1);
echo $ext;
echo "<br>";
echo "<hr>";
//获取文件拓展名 trim() strstr()
$file = 'index.php';
$ext = trim(strstr($file, '.'), ".");
echo $ext;
echo "<br>";
echo "<hr>";
//获取文件路径 basename()
$file = __FILE__;
$ext = substr($file, strrpos($file, '/'));
echo $ext;
echo "<br>";
echo "<hr>";





